from time import sleep
from selenium.webdriver.common.by import By
from base.base import Base

class SouSuoaPage(Base):

    sousuo = (By.ID,'com.xiachufang:id/search_edit_text')

    sousuoshurukuang  = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.EditText')

    sousuowenzi = 'new UiSelector().text("搜索")'

    dy = 'new UiSelector().text("菠菜")'


    def sousuoayewu(self):
        self.loc_ele(self.sousuo).click()
        sleep(4)
        self.loc_ele(self.sousuoshurukuang).send_keys("菠菜")
        sleep(4)
        self.loc_ui_ele(self.sousuowenzi).click()
        sleep(4)